local ClientOHOH =_G.ClientOHOH
local M = {}
local shopPanel = nil
local CallBackManager = ClientOHOH.load.CallBackManager()
function Initsts()
    local ui = {
        list = {},
    }
    for i=1,6 do
        ui.list[i] = {
            cell = "ctrl.wins."..i..".btn",
            count = "ctrl.wins."..i..".count",
            price = "ctrl.wins."..i..".price"
        }
    end
    return ui
end

function M.GetInitUiList()
    return Initsts()
end

function M.Init(ShopPanel)
    shopPanel = ShopPanel
end

function M.Full(data)
    local cellIndex = 0
    for index, value in pairs(data) do
        cellIndex = cellIndex+1
        local cell = shopPanel.insts.wins.list[index]
        cell.price.Text = value.price
        cell.count.Text = value.title
        CallBackManager:AddRbxConnect(shopPanel,cell.cell.Activated,function()
            shopPanel.ShopBuyEvent:Action(value.buyInfo)
        end)
        value.DataChange:Connect(function()
            cell.count.Text = value.title
        end)
    end
end

function M.Get()
    return M
end

return M 